home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Utilities / Laplace / Data / Include / standard.lh < prev    next >
Text File  |  1996-12-30  |  871b  |  36 lines

  1. /******************************************************/
  2. /* laplace standart library 21.12.1996 by P!\K / Un0X */
  3. /******************************************************/
  4.  
  5. /******************************************************/
  6. /* umatrix()                                          */
  7. /*   create square matrix of ones in the main         */
  8. /*   diagonal                                         */
  9. /******************************************************/
  10.  
  11. procedure umatrix(n)
  12. {
  13.   return( matrix(n,n,a,b,
  14.         if (a == b)
  15.         1;
  16.         else
  17.         0;
  18.       )
  19.     );
  20. }
  21.  
  22. /******************************************************/
  23. /* angle()                                            */
  24. /*   returns the angle between to vectors             */
  25. /******************************************************/
  26.  
  27. procedure angle(a,b)
  28. {
  29.   return(
  30.       acos(
  31.         a * b / (abs(a) * abs(b))
  32.           )
  33.     );
  34. }
  35.  
  36.